#include <bits/stdc++.h>
// 2025/07/23
// tag:
// Author: Forever
using namespace std;
using int64 = int64_t;
#define int long long
#define eps 1e-6
#define pow2(x) (x) * (x)
struct point {
    long double x, y;
    bool operator<(const point& a) const
    {
        return x < a.x || (x == a.x && y < a.y);
    }
} p[100001];

bool cmp(int x, int y)
{
    return p[x].y < p[y].y || (p[x].y == p[y].y && p[x].x > p[y].x);
}

long double cross(int x, int y, int z)
{
    return (p[y].x - p[x].x) * (p[z].y - p[x].y) - (p[y].y - p[x].y) * (p[z].x - p[x].x);
}

long double dis(int x, int y)
{
    return pow2(p[x].x - p[y].x) + pow2(p[x].y - p[y].y);
}

int n, stk[100001], stk2[100001], top, top2;
void hull()
{
    sort(p + 1, p + n + 1);
    for (int i = 1; i <= n; i++) {
        while (top >= 2 && cross(stk[top - 1], stk[top], i) <= eps)
            top--;
        stk[++top] = i;
    }
    int tmp = top;
    for (int i = n - 1; i >= 1; i--) {
        while (top > tmp && cross(stk[top - 1], stk[top], i) <= eps)
            top--;
        stk[++top] = i;
    }
    top--;
}

double R()
{
    int j = 2;
    long double ans = 0;
    while (cross(stk[1], stk[2], stk[j]) < cross(stk[1], stk[2], stk[j % top + 1]))
        j = j % top + 1;
    for (int i = 1; i <= top; i++) {
        while (cross(stk[i], stk[i % top + 1], stk[j]) < cross(stk[i], stk[i % top + 1], stk[j % top + 1]))
            j = j % top + 1;
        ans = max({ ans, dis(stk[i], stk[j]), dis(stk[i % top + 1], stk[j]) });
    }
    return ans;
}

long double merge(int l, int r)
{
    if (l == r)
        return 1e18;
    if (l + 1 == r)
        return dis(l, r);
    int mid = (l + r) >> 1;
    long double d = min(merge(l, mid), merge(mid + 1, r));
    top2 = 0;
    for (int i = l; i <= r; i++) {
        if ((p[i].x - p[mid].x) * (p[i].x - p[mid].x) <= d)
            stk2[++top2] = i;
    }
    sort(stk2 + 1, stk2 + top2 + 1, cmp);
    for (int i = 1; i <= top2; i++) {
        for (int j = i + 1; j <= top2; j++) {
            if (pow2(p[stk2[j]].y - p[stk2[i]].y) >= d)
                break;
            d = min(d, dis(stk2[i], stk2[j]));
        }
    }
    return d;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> p[i].x >> p[i].y;
    if (n == 2) {
        cout << dis(1, 2) << endl;
        return 0;
    }
    hull();
    cout << fixed << setprecision(6) << sqrt(merge(1, n)) << " " << sqrt(R()) << endl;
    return 0;
}